/**
 * Company : Thai Informatic System Co., Ltd.
 * Created By : Dr.Tree
 * Created On : Feb 7, 2012  6:20:24 PM 
 * e-Mail : chatree@tis.co.th
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : promis.utils
 * File Name : Parameter.java
 * TODO
 */
package promis.utility;

/**
 * @author chatree
 *
 */
public class Parameter {
	
	private String fieldName;
	private Object value;
	
	public Parameter(String fieldName, Object value){
		this.fieldName = fieldName;
		this.value = value;
	}
	
	public void add(String fieldName, Object value){
		this.fieldName = fieldName;
		this.value = value;
	}
	
	public String getFieldName() throws Exception{
		return this.fieldName != null ? this.fieldName : null; 
	}
	
	public String getFieldName(Parameter param) throws Exception{
		return param != null ? param.fieldName : null; 
	}
	
	public Object getFieldValue() throws Exception{
		return this.value != null ? this.value : null;
	}
	
	public Object getFieldValue(Parameter param) throws Exception{
		return param != null ? param.value : null;
	}
}
